{% extends 'dashboard/layout.html' %}
{% load i18n %}
{% load currency_filters %}

{% block title %}
    {% trans "Shipping methods" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        </li>
        <li class="active">{% trans "Shipping methods" %}</li>
    </ul>
{% endblock %}

{% block header %}
    <div class="page-header">
        <a id="create_new_shipping_method" href="{% url 'dashboard:shipping-method-create' %}" class="btn btn-primary btn-lg pull-right"><i class="icon-plus"></i> {% trans "Create new shipping charge" %}</a>
        <h1>{% trans "Shipping methods" %}</h1>
    </div>
{% endblock header %}

{% block dashboard_content %}
    <table class="table table-striped table-bordered">
        <caption><i class="icon-reorder icon-large"></i> {% trans "Shipping methods" %}</caption>
        {% if methods %}
            <thead>
                <tr>
                    <th>{% trans "Name" %}</th>
                    <th>{% trans "Number of weight bands" %}</th>
                    <th>{% trans "Default weight (kg)" %}</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {% for method in methods %}
                    <tr>
                        <td>
                            <a href="{% url 'dashboard:shipping-method-detail' pk=method.pk %}">{{ method.name }}</a>
                        </td>
                        <td>{{ method.num_bands }}</td>
                        <td>{{ method.default_weight }}</td>
                        <td>
                            <a href="{% url 'dashboard:shipping-method-detail' pk=method.pk %}" class="btn btn-default">{% trans "View" %}</a>
                            <a href="{% url 'dashboard:shipping-method-edit' pk=method.pk %}" class="btn btn-primary">{% trans "Edit" %}</a>
                            <a href="{% url 'dashboard:shipping-method-delete' pk=method.pk %}" class="btn btn-danger">{% trans "Delete" %}</a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        {% else %}
            <tr><td>{% trans "No shipping methods found." %}</td></tr>
        {% endif %}
    </table>
{% endblock %}
